home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / 8bit / sound / prtfrmts.txt < prev    next >
Text File  |  1995-04-22  |  5KB  |  103 lines

  1. Parrot .DIG Audio File Formats 
  2. ------------------------------ 
  3. Documented by Tony Ramos, May 29, 1994 
  4.  
  5. Overview 
  6. -------- 
  7. This document describes the data storage format for Parrot unstructured (raw) 
  8. and structured digital audio files.  The type of file cannot be determined 
  9. by filename alone since the Parrot software names all its files with the 
  10. extension ".DIG". 
  11.  
  12. I am providing this detailed information in the hope that Atari 8-bit users 
  13. will take advantage of their ability to store and reproduce digital sound with 
  14. their computer.  Perhaps someone will use this information to create new 
  15. sound manipulation software, such as a program to convert sounds sampled on 
  16. other computer platforms to Parrot format (hint hint). 
  17.  
  18. Introduction 
  19. ------------ 
  20. Parrot (and Parrot II) are programs for the Atari 8-bit line of 
  21. home computers which provide sound sampling and playback.  Sampling  
  22. is achieved through the computer's joystick port using a simple, paddle- 
  23. like device.  Sample playback uses the computer's internal sound 
  24. circuitry and requires no additional hardware. 
  25.  
  26. The Parrot _Sampler_ program records sound to disk as raw sample files. 
  27. Users can assemble these samples into a set of tracks using the _Emulator_ 
  28. program and play them as musical instruments on the computer's keyboard.  
  29. Sounds in track files can also be played from BASIC using calls to a freely 
  30. distributable subroutine included with Parrot. 
  31.  
  32. The Emulator saves each set of tracks as a "structured" file containing 
  33. track names and other information. 
  34.   
  35. Unstructured (raw) format: 
  36. -------------------------- 
  37.  
  38. Byte offset    Number of bytes  Description 
  39. -----------    ---------------  ----------- 
  40.  
  41.      0                5         Magic sequence to identify Parrot raw file: 
  42.                                 ASCII characters FGHIJ, $46-$4A hex. 
  43.  
  44.      6                1         Playback speed, in timing loops. ** 
  45.                                 Early versions of the software incorrectly 
  46.                                 set this byte to 75. 
  47.  
  48.  7-(11 or 12)      5 or 6       Sample length in bytes. ASCII numeric 
  49.                                 string terminated by an Atari EOL, $9B hex. 
  50.  
  51.   12 or 13      (length given   Sample data.  Samples are 4 bits each, 
  52.                    above)       two samples per byte, high nybble first. 
  53.  
  54. Structured (tracks) format: 
  55. --------------------------- 
  56.  
  57.      0                6         Magic sequence to identify Parrot track file: 
  58.                                 ASCII characters PQRSTU, $50-$55 hex. 
  59.  
  60.  7-(11 or 12)      5 or 6       Combined sample length in bytes. ASCII numeric 
  61.                                 string terminated by an ATASCII EOL, $9B hex. 
  62.  
  63.   12 or 13           82         Track name table with nine entries, each 
  64.                                 consisting of one byte containing the name 
  65.                                 length followed by the name as an ASCII 
  66.                                 string padded with NULLs ($00) to eight 
  67.                                 characters.  Table terminated by an ATASCII 
  68.                                 EOL, $9B hex. 
  69.  
  70.  102 or 103          72         Track data table.  Nine entries, each with 
  71.                                 the following structure: 
  72.  
  73.           Offset  Length Usage 
  74.           ------  ------ ----- 
  75.             0       2    Sample start offset, low byte first. 
  76.             2       2    Sample end offset, low byte first. 
  77.             4       1    Sample repeat flag, 1 = on. 
  78.             5       1    Audible track select flag, 1 = on. 
  79.             6       1    Audible track select speed, in busy loops. ** 
  80.             7       1    Not used. 
  81.  
  82.  174 or 175     (length given   Sample data table.  Samples are 4 bits each, 
  83.                    above)       two samples per byte, high nybble first. 
  84.  
  85.  
  86. ** The arbitrary `busy loops' timing measurement can be converted to 
  87.    conventional samples-per-second using the following formula: 
  88.  
  89. CPU_Speed   = 1790000    /* Clock speed of the Atari 8-bit's CPU         */ 
  90. Byte_Delay  = 96         /* Clocks spent playing each 2-sample byte      */ 
  91. Busy_Delay  = 5.5        /* Clocks spent during one busy loop (averaged) */ 
  92. Page_Delay  = 22         /* Clocks spent crossing sample page boundary   */ 
  93. Timing_Loops             /* Playback speed entered as above              */ 
  94.  
  95. Samples_Per_Second = CPU_Speed / ((Page_Delay + 256 * (Byte_Delay + 
  96.                                    Busy_Delay * Timing_Loops * 2)) / 512) 
  97.  
  98. For example, sounds sampled with Parrot at the default setting will play 
  99. at normal speed with `busy loops' set to 54.  This is equivalent to 5398 
  100. samples per second and provides audio frequency response of 2.7 KHz. 
  101.  
  102. At the default speed above, 2.7 KBytes store one second of sound. 
  103.